<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>1</button><button>2</button><button>3</button>
    <script>
        let btnAll = document.querySelectorAll('button');
        // console.log(btnAll);
        // console.log(btnAll.length);
        // let arr1 = Array.from(btnAll);//把伪数组变成真数组
        // console.log(arr1);
        // console.dir(Array);
        // let arr2 = Array.of('1',2,'iu',18,'jdhsfg');//把一些值变成真数组
        // console.log(arr2);
        let arr1 = [1,3,'dsfh',873,435,223];
        // console.log(arr1.push('516'));
        // arr1.push('516');
        // console.log(arr1);//添加数组尾部元素
        // arr1.pop();//删除数组尾部元素
        // console.log(arr1);
        // arr1.unshift('dfjgh');向数组头部添加元素
        // console.log(arr1);
        // arr1.shift();删除数组头部元素
        // console.log(arr1);
        // let result = arr1.find((item)=>{return item > 2});返回符合标准的第一个值
        // console.log(result);
        // let arr2 = Array.from(btnAll);
        // console.log(arr2);
        // let arr2 = Array.of(1,'iu',67,'iui',90);
        // console.log(arr2);
        let obj1 = {
            name:'iu'
            // age:18
        }
        let obj2 = {
            // name:'seola',
            age:19
        }
        let obj3 ={
            // name:'bona',
            // age:20
            sex:'女'
        }
        Object.assign(obj1,obj2,obj3);//把obj2 obj3上的属性方法都添加到obj1上
        console.log(obj1);
        // let obj4 = Object.create(obj1);把obj1上的属性添加到obj4的原型对象上
        // obj4.say = '汪汪汪';
        // console.log(obj4);
        // console.log(Object.entries(obj1));把该对象的所有属性和属性值变成数组
        let obj5 = Object.freeze(obj1);
        console.log(obj5);
        obj5.sex = '男';
        console.log(obj5);
        // console.log(Object.isFrozen(obj5));
        // console.log(Object.isFrozen(obj1));
        // console.log(Object.entries(obj1));
        // let arr = [['name','tom'],['age',18]];
        // let objArr = Object.fromEntries(arr);把数组变成对象
        // console.log(objArr);
        // let obj4 = {
        //     name:'李知恩'
        // }
        // let obj6 = {
        //     name:'雪娥'
        // }
        // console.log(Object.is(obj4,obj5));检查两个值是否是相同的
        // console.log(Object.is(1,1));
        // console.log(Object.keys(obj1));获取对象的所有key名
        // console.log(Object.values(obj1));获取对象的所有value值
        // Object.prototype.hobby = '玩游戏';
        // console.log(obj1.hasOwnProperty('name'));
        // for(let k in obj1){
        //     console.log(k);
        // }
    </script>
</body>
</html>